#include<iostream>
using namespace std;

template<typename T>
void Swap(T& a, T& b);

template<typename T>
void Swap(T* a, T* b, int n);

void show(int* p, int n);

int main()
{
	int i = 0, j = 1;
	cout << i << " " << j << endl;
	Swap(i, j);
	cout << i << " " << j << endl;
	
	int s1[5] = {1,2,3,4,5};
	int s2[5] = {6,7,8,9,0};
	show(s1 ,5);
	show(s2, 5);
	Swap(s1, s2, 5);
	show(s1 ,5);
	show(s2, 5);
	return 0;
}

template<typename T>
void Swap(T& a, T& b)
{
	T t = a;
	a = b;
	b = t;
}

template<typename T>
void Swap(T* a, T* b, int n)
{
	for (int i = 0; i < n; i++)
	{
		T t = a[i];
		a[i] = b[i];
		b[i] = t;
	}
}

void show(int* p, int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << p[i] << " ";
	}
	cout << endl;
}
